﻿@model IEnumerable<bugtracker.Models.LogEvent>

@{
    ViewBag.Title = "Index";
}

<script type="text/javascript">
    function ChangeColor(tableRow, highLight) {
        if (highLight) {
            tableRow.style.backgroundColor = '#9ff';
        }
        else {
            tableRow.style.backgroundColor = 'white';
        }
    }

    function DoNav(theUrl) {
        document.location.href = theUrl;
    }
</script>

<h2>Changes of interest</h2>

<table>
    <tr>
        <th>User who changed</th>
        <th>When changed</th>
        <th>Comment / What changed</th>
        <th>Bug ID#</th>
    </tr>


@foreach (var item in Model) {
    <tr onmouseover="ChangeColor(this, true);" 
              onmouseout="ChangeColor(this, false);" 
              onclick="loadPartialView('/Bugs/Details/@item.BugID', 'detailview');">
        <td>
            @Html.DisplayFor(modelItem => item.User)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreateTime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Comment)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.BugID)
        </td>
    </tr>
}


</table>
